package com.qssoft.cqry.synchdb.handler;

import com.qssoft.cqry.synchdb.adapter.MysqlBinlogAdapter;
import com.qssoft.cqry.synchdb.vo.MysqlBinlogVo;
import lombok.extern.slf4j.Slf4j;

/**
 * 处理sql语句
 * @author liju.z
 */
@Slf4j
public class MysqlBinlogHandler implements MysqlBinlogAdapter {

    private RedisSynchHandler redisSynchHandler;

    public MysqlBinlogHandler(RedisSynchHandler redisSynchHandler) {
        this.redisSynchHandler = redisSynchHandler;
    }

    @Override
    public void sqlHandler(MysqlBinlogVo mysqlBinlogVo) {
        redisSynchHandler.sendSynchData(mysqlBinlogVo);
    }
}
